<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>HTML预览</title>
    <style>
        body {
            margin: 0;
            padding: 20px;
            background: #f0f0f0;
        }
        .preview-container {
            background: white;
            padding: 20px;
            border-radius: 8px;
            box-shadow: 0 2px 10px rgba(0,0,0,0.1);
            max-width: 800px;
            margin: 0 auto;
        }
        .preview-actions {
            margin-bottom: 20px;
            text-align: center;
        }
        .btn {
            padding: 10px 20px;
            margin: 0 10px;
            border: none;
            border-radius: 4px;
            cursor: pointer;
            text-decoration: none;
            display: inline-block;
        }
        .btn-primary {
            background: #007bff;
            color: white;
        }
        .btn-success {
            background: #28a745;
            color: white;
        }
        .preview-frame {
            width: 100%;
            height: 600px;
            border: 1px solid #ccc;
            background: white;
        }
    </style>
</head>
<body>
    <div class="preview-container">
        <div class="preview-actions">
            <a href="/static/{{ filename }}" target="_blank" class="btn btn-success">打开打印页面</a>
            <a href="/" class="btn btn-primary">返回编辑</a>
        </div>
        <iframe src="/static/{{ filename }}?preview=true" class="preview-frame"></iframe>
    </div>
</body>
</html>